var PathToAjaxBackend = '/js/ajax.php';
function ratethis(obj_id,module,grade,el_id)
{
	// Create new JsHttpRequest object.
	var req = new JsHttpRequest();
	action='rating';

    // Code automatically called on load finishing.
    req.onreadystatechange = function()	{
        if (req.readyState == 4)
		{
            //get errors from backend
            if(req.responseText)
            {
                $.facebox(req.responseText);
            }
			//get data from backend		
            if (req.responseJS)
            {
            	if(req.responseJS.ok && req.responseJS.ok == '0')
            	{
					$.facebox(req.responseJS.output);	                
            	}
            	else
            	{
            		$("#"+el_id).html(req.responseJS.output);
            	}
            }
        }
    }
    // Prepare request object (automatically choose GET or POST).
    req.open(null, PathToAjaxBackend, true);
	req.send({action:action,obj_id:obj_id,module:module,grade:grade});
}